package com.ruoyi;

import com.ruoyi.ai.domain.SysAiTasks;
import com.ruoyi.system.service.ISysAIService;
import com.ruoyi.system.service.impl.SysAIServiceImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

import java.io.IOException;
import java.text.ParseException;
import java.util.Date;

/**
 * 启动程序
 *
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{

    public static void main(String[] args) throws Exception {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(RuoYiApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  若依启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");

        //主进程，分析语义
        while (true){
            System.out.println((new Date()).toString() + " Run taskAnalysis ...");
            //SysAIServiceImpl.taskListHandled();//暂时 不用
            Date now = new Date();
            SysAIServiceImpl.taskListMergeHandled(now);//一天内 收集
            //SysAIServiceImpl.addQYWXSchedulePre(new SysAiTasks());//测试

            System.out.println((new Date()).toString() + " Run taskAnalysis ... finish");
            Thread.sleep(600*1000);//默认 1小时一次   测试 10分钟一次  600*1000

        }
    }
}
